package ua.com.ulitko.client;

import com.google.gwt.dom.client.Style;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * @author suamo ( 01.04.12 2:26 )
 */
public class ClientUtil {

    public static void setToRightPanel(Widget widget) {
        LayoutPanel layoutPanel = (LayoutPanel) RootLayoutPanel.get().getWidget(0);
        if (layoutPanel.getWidgetCount() == 2) {
            layoutPanel.remove(1);
        }
        layoutPanel.add(widget);
        layoutPanel.setWidgetRightWidth(widget, 0, Style.Unit.PCT, 60, Style.Unit.PCT);
    }
}
